import {
  mapGetters,
  mapMutations,
} from "vuex";

export default {
  filters: {
    /**
     * 处理空数据，及正常数据显示
     * @param {Number|String} value - 数据
     * @param {String} before - 数据前缀
     * @param {String} after - 数据后缀
     * @returns {String} - 处理后的值
     */
    dispose(value, before = '', after = '') {
      return value ? before + value + after : '-'
    }
  },
  data: function () {
    return {
      imgUrl: this.$config.img
    }
  },
  computed: {
    ...mapGetters('user', ['getState', 'getUser', 'getForm', 'getToken']) // 获取数据  后可以使用this.getUser
  },
  methods: {
    ...mapMutations('user', ['setUser', 'setForm', 'setToken'])
  }
}